Skip to content

CA-403851 stop management server in Pool.eject () #6346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

lindig
Copy link
Contributor

@lindig lindig commented Mar 7, 2025

We are stopping the management server at the end of the API call. This avoids clients connecting to this host before it has rebooted and become a pool master.

Tested manually; running a BST now.

@lindig lindig requested a review from edwintorok March 7, 2025 11:01
@lindig lindig force-pushed the private/christianlin/CA-403851 branch from 9334508 to 4d60ae6 Compare March 7, 2025 11:03
@@ -2074,6 +2074,8 @@ let eject_self ~__context ~host =
)
)
(fun () -> Xapi_fuse.light_fuse_and_reboot_after_eject ()) ;
debug "%s: stop management server" __FUNCTION__ ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be done earlier? It's not clear when calling this server being to be problematic, but it looks like it should be between unplugging PBDs (line 1875) and declaring itself ot be the master (line 2016)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think anything before the API call returns is reasonable; a client should not make any assumptions before the call returns.

val stop : unit -> unit
(** Stop server for external API calls *)
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's strange to expose internal module Server with just one interface in the signature, while the real signature of Server contains more.
Suggest wrapping it as function stop_server and expose it in the upper module, which is Xapi_mgmt_iface

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to use modules to provide a clear name space.

Copy link
Contributor

@changlei-li changlei-li Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The status which stored in ref mode in xapi_mgmt_iface.ml L122 will not be updated. I don't know if it matters. I think it's better to use Server.(update __context Off) to implement this function.

Copy link
Member

@robhoes robhoes Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a way to stop the server using the current interface, as used by the host.management_disable call: https://github.com/xapi-project/xen-api/blob/master/ocaml/xapi/xapi_host.ml#L1297.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update of status should be implemented by the stop function and seems to be missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now using the method @robhoes proposed and removed the commit that exposed Server.stop.

@lindig lindig force-pushed the private/christianlin/CA-403851 branch from 4d60ae6 to 68dc84d Compare March 10, 2025 15:14
@lindig
Copy link
Contributor Author

lindig commented Mar 10, 2025

BST have passed now

@lindig
Copy link
Contributor Author

lindig commented Mar 10, 2025

BST after rebasing has now passed.

We are stopping the management server at the end of the API call. This
avoids clients connecting to this host before it has rebooted and become
a pool master.

Signed-off-by: Christian Lindig <christian.lindig@cloud.com>
@lindig lindig force-pushed the private/christianlin/CA-403851 branch from 68dc84d to 9b1b8d4 Compare March 11, 2025 10:16
@lindig lindig added this pull request to the merge queue Mar 11, 2025
Merged via the queue into xapi-project:master with commit d02e3b5 Mar 11, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants